import React,{useState,useEffect} from 'react';
// import{useNavigate} from 'react-router-dom';
import Item from '../components/index'
import axios from 'axios'
const Index = () => {
    const [movies,setMovies] = useState([]);
    // const Navigate=useNavigate()
    const fecthData=async ()=>{
        var res = await axios.get('http://122.112.161.135:4000/api/movie/top250');
        setMovies(res.data.res)
    }
    useEffect(() => {
        fecthData()
    }, []);
    return (
        <div>
            <Item data={movies}></Item>
        </div>
    );
}

export default Index;
